
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<header class="page">
    <div class="status">
        <ul class="nav justify-content-end">
            <c:choose>
                <%--若会话对象中存在customer则认为用于已经登录--%>
                <c:when test="${ not empty sessionScope.customer }">
                    <li class="nav-item">
                        欢迎${customer.nickname}
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/list">首页</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/publish">发布话题</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/mine">我的话题</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/edit?id=${customer.id}">
                            <i class="fa fa-cog"></i>设置
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/change?id=${customer.id}">修改密码</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/out">
                            <i class="fa fa-sign-out" aria-hidden="true"></i>
                            退出
                        </a>
                    </li>
                </c:when>
                <c:otherwise>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/up">
                            <i class="fa fa-user-circle-o" aria-hidden="true"></i>
                            注册
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/in">
                            <i class="fa fa-sign-in" aria-hidden="true"></i>
                            登录
                        </a>
                    </li>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>
    <div class="logo">
        <div class="logo-img"></div>
        <div class="ad">
            <form action="${ctxPath}/topic/search" method="post">
                <input type="text" name="keyworkd" placeholder="请输入话题搜索关键字">
                <button type="submit">搜索</button>
            </form>
        </div>
    </div>
</header>